package com.example.blog.mapper;

import com.example.blog.entity.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {

    Article selectById(Long id);

    List<Article> selectByUserId(Long userId);

    List<Article> selectByTitleContaining(String keyword);

    List<Article> selectAllOrderByCreateTimeDesc();

    List<Article> selectByCategoryId(Long categoryId);

    int insert(Article article);

    int update(Article article);

    int deleteById(Long id);

    int incrementLikeCount(Long id);

}